/*
 * 上海远境文化传媒有限公司 版权所有
 */
package response.admin;

import admin.AdminRole;
import cn.hutool.core.date.DateUtil;

/**
 * 角色Response
 */
public class AdminRoleDTO {

    /**
     * ID.
     */
    public String id;

    /**
     * 角色名.
     */
    public String name;

    /**
     * 备注.
     */
    public String remark;

    /**
     * 显示顺序.
     */
    public Integer showOrder;

    /**
     * 创建时间.
     */
    public String createdAt;

    /**
     * 更新时间.
     */
    public String modifyAt;


    /**
     * 操作业务
     */
    public String[] operateIds;


    public static AdminRoleDTO from(AdminRole role) {
        AdminRoleDTO response = new AdminRoleDTO();
        response.id = role.id;
        response.name = role.name;
        response.showOrder = role.showOrder;
        response.remark = role.remark;
        response.createdAt = DateUtil.formatDateTime(role.createAt);
        response.modifyAt = DateUtil.formatDateTime(role.modifyAt);
        return response;
    }
}
